<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>forin</title>
</head>

<body>
  <script>
    let o = { x: 1, y: 2, z: 3 }
    for (let p in o) {
      console.log(p);
    }
    // debugger
    let a = [], i = 0
    for (a[i++] in o);
    console.log(a);
    for (let i in a) console.log(i);
  </script>
</body>

</html>